import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { noticeQuery, noticeList, noticeForm, adGroupData } from "./types";


/**
 * 公告列表
 */
export function noticePageList(data: noticeQuery): AxiosPromise<PageResult<noticeList[]>> {
  return request({
    url: "/admin/content/notice/pageList",
    method: "post",
    data
  });
}


/**
 * 新增公告
 */
export function addNotice(data: noticeForm) {
  return request({
    url: "/admin/content/notice/add",
    method: "post",
    data
  });
}


/**
 * 新增公告
 */
export function editNotice(data: noticeForm) {
  return request({
    url: "/admin/content/notice/update",
    method: "post",
    data
  });
}


/**
 * 公告详情
 */
export function noticeInfo(data: any) {
  return request({
    url: "/admin/content/notice/detail",
    method: "post",
    data
  });
}


/**
 * 删除公告
 */
export function noticeDel(data: any) {
  return request({
    url: "/admin/content/notice/del",
    method: "post",
    data
  });
}


/**
 * 轮播组
 */
export function adGroupList(data: noticeQuery): AxiosPromise<PageResult<adGroupData[]>> {
  return request({
    url: "/admin/content/adGroup/pageList",
    method: "post",
    data
  });
}


/**
 * 添加轮播组
 */
export function adGroupAdd(data: any) {
  return request({
    url: "/admin/content/adGroup/add",
    method: "post",
    data
  });
}


/**
 * 更新轮播组
 */
export function adGroupUpdate(data: any) {
  return request({
    url: "/admin/content/adGroup/update",
    method: "post",
    data
  });
}


/**
 * 更新轮播组
 */
export function adGroupDel(data: any) {
  return request({
    url: "/admin/content/adGroup/del",
    method: "post",
    data
  });
}

// 获取轮播
export function contentAll(data: any) {
  return request({
    url: "/admin/content/ad/all",
    method: "post",
    data
  });
}

// 新增轮播
export function contentAdd(data: any) {
  return request({
    url: "/admin/content/ad/add",
    method: "post",
    data
  });
}

// 修改轮播
export function contentEdit(data: any) {
  return request({
    url: "/admin/content/ad/update",
    method: "post",
    data
  });
}


// 删除轮播
export function contentDel(data: any) {
  return request({
    url: "/admin/content/ad/del",
    method: "post",
    data
  });
}

